﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AMS.Configuration
{
    /// <summary>
    /// 列信息
    /// </summary>
    public class ColumnInfo
    {
        /// <summary>
        /// 列信息
        /// </summary>
        public ColumnInfo()
        {
        }

        /// <summary>
        /// 列信息
        /// </summary>
        /// <param name="name">列名</param>
        public ColumnInfo(string name)
            :this()
        {
            Name = name;
        }

        /// <summary>
        /// 所属于的视图
        /// </summary>
        public string ViewName { get; set; }

        /// <summary>
        /// 列名
        /// </summary>
        public virtual string Name { get; set; }

        /// <summary>
        /// 标题名
        /// </summary>
        public virtual string Caption { get; set; }

        /// <summary>
        /// 对应的数字字典
        /// </summary>
        public virtual int DictKey { get; set; }

        /// <summary>
        /// 是否显示列
        /// </summary>
        public virtual bool IsDisplay { get; set; }

        /// <summary>
        /// 列宽的整数
        /// </summary>
        public virtual int Width { get; set; }

        /// <summary>
        /// 水平方向的对齐
        /// </summary>
        public virtual VerticalAlignment HAlign { get; set; }

        /// <summary>
        /// 列序号，有时候并不会为其赋值，而依赖于它所在的容器的序号
        /// </summary>
        public virtual int OrderIndex { get; set; }

        /// <summary>
        /// 显示格式
        /// </summary>
        public virtual string Format { get; set; }

        /// <summary>
        /// 扩展数据
        /// </summary>
        public virtual object State { get; set; }

        //internal ColumnInfoCollection container;
        ///// <summary>
        ///// 宿主,斩未使用
        ///// </summary>
        //protected internal ColumnInfoCollection Container
        //{
        //    get { return container; }
        //}

        /// <summary>
        /// 位于容器中的序号，斩未使用
        /// </summary>
        //public int Index
        //{
        //    get
        //    {
        //        if (container == null)
        //        {
        //            return -1;
        //        }

        //        return container.IndexOf(this);
        //    }
        //}
    }
}
